package com.zhuxiang.test1;

public class Point {
    //横坐标
    private int x;
    //纵坐标
    private int y;

    public Point(int x, int y) {
        setX(x);
        setY(y);
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        if (x<0){
            System.out.println("输入有误");
        }else {
            this.x = x;
        }
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        if (y<0){
            System.out.println("输入有误");
        }else {
            this.y = y;
        }
    }
}
